package Interface;

import javax.swing.JTabbedPane;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

import espaceVisuCarre.java2Dutil.JCanvas;

public class TabbedpanelDroite extends JTabbedPane {

	private static final long serialVersionUID = 1L;
	private FrameDemo saFenetrePrincipale ;
	private PanelUnivers panelUnivers ;
	private JCanvas panelCarre ;
	/**
	 * This is the default constructor
	 */
	public TabbedpanelDroite(FrameDemo fenetre)
	{
		super();
		this.saFenetrePrincipale = fenetre;
		initialize();
	}

	
	
	
	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() 
	{
		panelUnivers = new PanelUnivers(saFenetrePrincipale);

		//mise a jour planete par rapport aux parametre initiaux :
		panelUnivers.MAJ_ReferenceMinMAxPlanete(); //nouvelles references de taille de planetespar rapport au zoom !
		//mise a jour de la taille des planetes:
		panelUnivers.MAJ_TaillePlanete();
		//MAJ couleur planetes :
		panelUnivers.sonUnivers.MAJCouleurPlaneteParRapportGenres(saFenetrePrincipale.getSaBib());
		panelUnivers.repaint();
		
		
		this.addTab("Univers", panelUnivers);
		

		
		this.panelCarre = new JCanvas( this.saFenetrePrincipale );
		this.addTab("Carre", panelCarre );
		panelCarre.centrer();
		
		
//		addChangeListener(new ChangeListener() 
//		{
//	        // This method is called whenever the selected tab changes
//	        public void stateChanged(ChangeEvent evt) {
//	            JTabbedPane pane = (JTabbedPane)evt.getSource();
//	            int sel = pane.getSelectedIndex();
//	        }
//	    });
	}
	
	public PanelUnivers getPanelUnivers() {
		return panelUnivers;
	}

	public JCanvas getPanelCarre() {
		return this.panelCarre;
	}
}
